<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested"%>
<h2>
		<bean:write name="productForm" property="categoryName" />
		&gt;&gt;
		<bean:write name="productForm" property="subcategoryName" />
</h2>
<h3>Goods:</h3>
<nested:form action="productAction.do?method=save" onsubmit="return checkData(this)">
	<table>
		<tr>
			<td>
				<h4>Producer</h4>
			</td>
			<td>
				<h4>Model</h4>
			</td>
			<td>
				<h4>Date of issue</h4>
			</td>
			<td>
				<h4>Color</h4>
			</td>
			<td>
				<h4>Price</h4>
			</td>
			<td><h4>Not in stock</h4></td>
		</tr>
		<nested:nest
			property="document.rootElement.children[${productForm.categoryId}].children[${productForm.subcategoryId}].children">
			<nested:iterate id="goods" indexId="goodsNumber">
				<tr>
					<td><nested:text property="children[0].text" size="20" /></td>
					<td><nested:text property="children[1].text" size="20" /></td>
					<td><nested:text property="children[2].text" size="20" /></td>
					<td><nested:text property="children[3].text" size="20" /></td>
					<nested:equal value="not-in-stock" property="children[4].name">
						<td><nested:text property="children[4].text" size="20" style="background-color:#dddddd;" disabled="true" value=""/></td>
					</nested:equal>
					 <nested:equal value="price" property="children[4].name">
						<td><nested:text property="children[4].text" size="20" /></td>
					</nested:equal>
					<td>
						<nested:checkbox property="children[4].name" value="not-in-stock" onclick="goodsCheckbox(this);" />
						<nested:hidden property="children[4].name" value="price" />
					</td>
				</tr>
			</nested:iterate>
		</nested:nest>
	</table>		
	<div style="float: left; width: 150px; margin-left: 76">
		<nested:submit style="width: 150px;">Save changes</nested:submit>
	</div>
</nested:form>
<div style="float: left; margin-top: -19; margin-left: -270">
	<nested:form action="productAction.do?method=subcategoryList">
		<input type="submit" name="buttonBack" value="Back"	style="width: 150px;" />
	</nested:form>
</div>
<div style="float: left; margin-top: -19;">
	<nested:form action="productAction.do?method=add">
		<input type="submit" value="Add goods" style="width: 150px;" />
	</nested:form>
</div>		